package com.zhanjixun.data.dao;

import com.zhanjixun.data.domain.GoodDTO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author :zhanjixun
 * @date : 2019/1/8 22:31
 */
public interface DAO {

    @Insert("<script>" +
            "INSERT IGNORE INTO good(link,gId,img,price,oldPrice,coupon,title,goodSum,goodType)  " +
            "VALUES " +
            "<foreach item ='item' collection='users' separator=','>" +
            "(#{item.link},#{item.gId},#{item.img},#{item.price},#{item.oldPrice},#{item.coupon},#{item.title},#{item.goodSum},#{item.goodType})" +
            "</foreach>" +
            "</script>")
    int insertGood(@Param("users") List<GoodDTO> users);

}
